package com.jxb;

import com.jxb.protobuf.OrderQueryGrpc;
import com.jxb.service.OrderQueryServiceImpl;
import com.jxb.service.RPCDateServiceImpl;
import io.grpc.ServerBuilder;

import java.io.IOException;

public class Server {

    public static void main(String[] args) throws IOException, InterruptedException {
        io.grpc.Server server = ServerBuilder.forPort(9999)
                .addService(new RPCDateServiceImpl())
                .addService(new OrderQueryServiceImpl())
                .build()
                .start();

        System.out.println(String.format("GRpc服务端启动成功, 端口号: %d.", 9999));

        server.awaitTermination();
    }

}
